//
//  RequestTool.h
//  PgyHelper
//
//  Created by 鹏鹏 on 2020/11/12.
//  Copyright © 2020 CleverPeng. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MBProgressHUD+LZPShow.h"
#import "NSString+ChangeUnicode.h"
#import <Masonry/Masonry.h>
#import <MJRefresh/MJRefresh.h>
#import <YYModel/YYModel.h>
#import <SDWebImage/SDWebImage.h>

NS_ASSUME_NONNULL_BEGIN

#define NSLog(format, ...) printf("\n[%s] %s [第%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);

#define KEY_API_KEY @"KEY_API_KEY"

#define HOST_URL_Base @"https://www.pgyer.com"
#define HOST_URL_app_view [NSString stringWithFormat:@"%@/apiv2/app/view", HOST_URL_Base]
#define HOST_URL_app_listMy [NSString stringWithFormat:@"%@/apiv2/app/listMy", HOST_URL_Base]
#define HOST_URL_app_icons(buildIcon) [NSString stringWithFormat:@"%@/image/view/app_icons/%@", HOST_URL_Base, buildIcon]
#define HOST_URL_app_builds [NSString stringWithFormat:@"%@/apiv2/app/builds", HOST_URL_Base]
#define HOST_URL_app_buildDelete [NSString stringWithFormat:@"%@/apiv2/app/buildDelete", HOST_URL_Base]

#define WEAKSELF __weak typeof(self) weakSelf = self;

@interface RequestTool : NSObject

+ (void)postWith:( NSString * _Nonnull )urlString paramsString:( NSString * _Nullable )paramsString completeHandler:(void(^)(NSString * __nullable responseString, NSDictionary * __nullable responseDataDic, BOOL isSuccess, NSString * _Nullable message))completeHandler;

+ (void)parasResponse:(NSData *)data completeHandler:(void(^)(NSString * __nullable responseString, NSDictionary * __nullable responseDataDic, BOOL isSuccess, NSString * _Nullable message))completeHandler;

+ (NSString *)get_api_key;
+ (NSString *)reset_api_key;
+ (BOOL)save_api_key:(NSString *)api_key;
@end

NS_ASSUME_NONNULL_END
